package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
@Table(name = "qhandled", schema = "springboot", catalog = "")
public class QhandledEntity {
    private int handledId;
    private String handledName;
    private String handledGsname;
    private String handledDh;
    private Collection<QpurchaseEntity> qpurchaseEntities;


    @OneToMany(mappedBy = "handledId")
    public Collection<QpurchaseEntity> getQpurchaseEntities() {
        return qpurchaseEntities;
    }
    public void setQpurchaseEntities(Collection<QpurchaseEntity> qpurchaseEntities) {
        this.qpurchaseEntities = qpurchaseEntities;
    }


    @Id
    @Column(name = "handled_id")
    public int getHandledId() {
        return handledId;
    }

    public void setHandledId(int handledId) {
        this.handledId = handledId;
    }

    @Basic
    @Column(name = "handled_name")
    public String getHandledName() {
        return handledName;
    }

    public void setHandledName(String handledName) {
        this.handledName = handledName;
    }

    @Basic
    @Column(name = "handled_gsname")
    public String getHandledGsname() {
        return handledGsname;
    }

    public void setHandledGsname(String handledGsname) {
        this.handledGsname = handledGsname;
    }

    @Basic
    @Column(name = "handled_dh")
    public String getHandledDh() {
        return handledDh;
    }

    public void setHandledDh(String handledDh) {
        this.handledDh = handledDh;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        QhandledEntity that = (QhandledEntity) o;
        return handledId == that.handledId &&
                Objects.equals(handledName, that.handledName) &&
                Objects.equals(handledGsname, that.handledGsname) &&
                Objects.equals(handledDh, that.handledDh);
    }

    @Override
    public int hashCode() {
        return Objects.hash(handledId, handledName, handledGsname, handledDh);
    }
    public QhandledEntity(int handledId) {
        this.handledId = handledId;
    }

    public QhandledEntity() {
    }
}
